
DLL_FILES := readud.dll lSDL.dll lgl.dll drw.dll dcallback.dll callbackfunc.dll lSDL_image.dll lSDL_mixer.dll lSDL_ttf.dll dcall.dll

all:$(DLL_FILES)

CFLAGS += -lSDL2 -lSDL2_image -lSDL2_mixer -lSDL2_ttf -O2

clean:
	-rm $(DLL_FILES)
	
test:all
	lua test.lua

%.dll:%.c
	gcc -shared $(<) -llua -lopengl32 $(CFLAGS) -o $(@)

lSDL.dll:lsdl2.c
	gcc -shared $(<) -llua $(CFLAGS) -o $(@)
	
drw.dll:../../clib/drw.c
	gcc -shared $(<) -llua $(CFLAGS) -o $(@)
	
dcall.dll:../../clib/dcall.c
	gcc -shared $(<) -llua $(CFLAGS) -o $(@)

dcallback.dll:../../clib/dcallback.c
	gcc -shared $(<) -llua $(CFLAGS) -o $(@)

lgtk.dll:lgtk.c
	gcc -shared $(<) -llua `pkg-config --cflags --libs gtk+-3.0` $(CFLAGS) -o $(@)

callbackfunc.dll:../../clib/callbackfunc.c
	gcc -shared $(<) -llua $(CFLAGS) -o $(@)
